package org.jeecg.modules.zcgl.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.zcgl.entity.AssetContractLog;
import org.jeecg.modules.zcgl.entity.LeaseContractInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @Description: 资产签订合同记录信息
 * @Author: jeecg-boot
 * @Date:   2021-01-26
 * @Version: V1.0
 */
public interface IAssetContractLogService extends IService<AssetContractLog> {

    /**
     *
     * 创建资产合同签订日志
     * @param assetId
     * @param assetSubId
     * @param rentStartTime
     * @param leaseContractInfo
     * @return
     */
    @Transactional
    boolean creatorLog(String assetId, String assetSubId,Date rentStartTime, LeaseContractInfo leaseContractInfo);

    /**
     * 根据条件，把状态修改为已结束
     * @param assetId
     * @param leaseContractId
     * @param assetSubId
     * @return
     */
    @Transactional
    boolean updateEnd(String assetId, String leaseContractId, String assetSubId);

    /**
     * 根据条件查询数量
     * @param assetId
     * @param leaseContractId
     * @param assetSubId
     * @param izEnd
     * @return
     */
    int countNum(String assetId, String leaseContractId, String assetSubId, Integer izEnd);

    /**
     * 根据条件查询最后到期的对象
     * @param assetId
     * @param leaseContractId
     * @param assetSubId
     * @param izEnd
     * @return
     */
    Date selectMaxRentEndTimeByKey(String assetId, String leaseContractId, String assetSubId, Integer izEnd);
}
